/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package app;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import org.kxml.kdom.*;
import parser.CargaXML;
import gui.MenuPrincipal;
import ral.Real;


/**
 * @author REX
 */
public class ConsultaCartelera extends MIDlet {
    public Display pantalla;
    public int saldo;
    public Real latitud;
    public Real longitud;
    final String url = "http://www.ngwise.com/cm/inicio.php";
    public void cargaDatosIniciales(){
        Element root = CargaXML.obtenRoot(url);
        this.saldo = Integer.parseInt( root.getElement("saldo").getText() );
        this.latitud = new Real( root.getElement("lat").getText() );
        this.longitud = new Real( root.getElement("long").getText() );
        System.out.println("Saldo "+this.saldo);
        System.out.println("Saldo "+saldo);
    }

    public void startApp() {
         cargaDatosIniciales();
         pantalla = Display.getDisplay(this);
         MenuPrincipal mp = new MenuPrincipal(this);
         pantalla.setCurrent(mp);
    }

    public void pauseApp() {
    }
    public void exit() {
        destroyApp(false);
        notifyDestroyed();

    }
    public void destroyApp(boolean unconditional) {
    }

    public Real getLatitud()
    {
     return this.latitud;
    }


    public Real getLongitud()
    {
     return this.latitud;
    }


}
